package top.huxy.boot.controller.admin;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.huxy.boot.annotation.RequestRemake;
import top.huxy.boot.model.dto.Pager;
import top.huxy.boot.model.dto.Query;
import top.huxy.boot.model.entity.OperationLog;
import top.huxy.boot.service.impl.OperationLogServiceImpl;
import top.huxy.boot.util.obj.Result;

/**
 * @Classname operationLogController
 * @Description operationLogController
 * @Date 2021/9/25 12:50
 * @Created by huxy
 */
@RestController
@RequestMapping("/admin/operationLog")
public class OperationLogController {

    OperationLogServiceImpl operationLogService;

    public OperationLogController(OperationLogServiceImpl operationLogService) {
        this.operationLogService = operationLogService;
    }

    @GetMapping("/getOperationLogList")
    @RequestRemake("获取操作日志")
    public Result getOperationLogList(Pager pager, Query query) {
        PageHelper.startPage(pager.getPage(),pager.getPageSize(),"create_time desc");
        PageInfo<OperationLog> pageInfo=new PageInfo<>(operationLogService.getOperationLogList(query));
        return Result.success(pageInfo);
    }
}
